#include <algorithm>
#include <cstdint>
#include <iostream>
#include <istream>
#include <map>
#include <unordered_map>
#include <vector>
using ll = int64_t;

ll n,b,ans;
struct P{
    ll x,y;
    inline bool operator<(const P&o)const{
        return x<o.x;
    }
    inline bool operator==(const P&o)const{
        return x==o.x&&y==o.y;
    }
}g;
std::vector<P> a;
std::unordered_map<ll,std::unordered_map<ll,ll>> m;

int main(){
    std::iostream::sync_with_stdio(false);
    std::cin.tie(nullptr);

    std::cin>>n;
    a.resize(n+1);
    for(ll i=1;i<=n;i++){
        std::cin>>a[i].x>>a[i].y;
    }
    std::cin>>g.x>>g.y;
    std::sort(a.data()+1,a.data()+1+n);
    if(n==1){
        if(a[1]==g){
            std::cout<<"1\n";
        }else{
            std::cout<<"0\n";
        }
        return 0;
    }
    b=n/2+1;
    for(ll tmp=1;tmp<(1ull<<(b-1));tmp++){
        ll ax=0,ay=0;
        for(ll j=0;j<b-1;j++){
            if(tmp&(1ll<<j)){
                const ll nj=j+1;
                ax+=a[nj].x;
                ay+=a[nj].y;
            }
        }
        m[ax][ay]++;
    }
    // for(ll msk=1;msk<(1ull<<(n-b)))
}